package com.sikaryofficial.backend.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sikaryofficial.backend.domain.entity.ActivityAttendRec;
import com.sikaryofficial.backend.domain.vo.export.ActivityAttendStatisticsVO;
import com.sikaryofficial.backend.mapper.ActivityAttendRecMapper;
import com.sikaryofficial.backend.service.IActivityAttendRecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 活动参与记录Service业务层处理
 *
 * @author qinjinyuan
 * @date 2024-07-29
 */
@Service
public class ActivityAttendRecServiceImpl extends ServiceImpl<ActivityAttendRecMapper, ActivityAttendRec> implements IActivityAttendRecService {
    @Autowired
    private ActivityAttendRecMapper activityAttendRecMapper;

    /**
     * 根据活动ID查询参与统计记录
     *
     * @param activityIds
     * @return
     */
    @Override
    public List<ActivityAttendStatisticsVO> queryStatistics(List<Long> activityIds) {
        if (CollUtil.isEmpty(activityIds)) {
            return Collections.emptyList();
        }
        return activityAttendRecMapper.queryStatistics(activityIds);
    }
}
